package com.xiaocai.objview.gl;

import android.content.Context;
import android.opengl.GLES20;

import com.xiaocai.objview.utils.TextResourceReader;

public class ShaderProgram {

    protected int program;

    public ShaderProgram(Context context, int vertexShaderResId, int fragmentShaderResId) {
        program = ShaderHelper.buildProgram(TextResourceReader.readTextFileFromResource(context, vertexShaderResId),
                TextResourceReader.readTextFileFromResource(context, fragmentShaderResId));
    }

    public void useProgram() {
        GLES20.glUseProgram(program);
    }
}
